package com.xxx.mapper;

import com.xxx.pojo.ShoppingCart;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ShoppingCartMapper {


    @Insert("insert into shopping_cart values (#{dishName},#{img},#{userId},#{dishId},#{packageId},#{num},#{price},#{createTime})")
    int insertShopping(ShoppingCart shoppingCart);

    @Select("select * from shopping_cart;")
    @ResultMap("ShoppingCartResultMap")
    List<ShoppingCart> selectAll();

    @Delete("delete from shopping_cart;")
    int delAll();
}
